<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" href="/Public/js/datepicker/datepicker.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">
		
		<link rel="stylesheet" type="text/css" href="/Public/js/select2/select2.css" media="all"/>

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>
		
		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>

        <script type="text/javascript" src="/Public/crm/js/index.js"></script>

        <script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/select2.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/jquery.core.js"></script>

	</head>

<body>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.all.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/moment.min.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.en.js"></script>

    <div class="fd-right-main">

        

	<div class="hidden hg100 layui-form" id="Memberlist">

	<div class="feeldesk-form pd0 feelcrm-form">

		<div class="layui-tab">

			<ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('USER_LIST');?></li>

				<li class="tab-title-btn">

					<a href="javascript:void(0);" id="memberDetailLay" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

					<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

					<div class="clear"></div>

				</li>

				<form1 action="" class="fr selectMemberForm" method="get">

					<div class="compact-search">

						<i class="iconfont icon-search"></i>

						<input type="text" name="selectMemberKeyword" value="" placeholder="<?php echo L('NAME1');?>/<?php echo L('CELL_PHONE');?>"/>

						<a href="javascript:" class="selectMemberBtn"><?php echo L('SEARCH');?></a>

					</div>

				</form1>

			</ul>

		</div>

	</div>

	<div class="feelcrm-list">

		<table class="layui-table" lay-skin="line">

			<thead>

				<tr>

					<th></th><th><?php echo L('NAME');?></th><th><?php echo L('EMAIL');?></th><th><?php echo L('MOBILE');?></th><th><?php echo L('SUBORDINATE_SECTOR');?></th><th><?php echo L('ROLE');?></th>

				</tr>

			</thead>

			<tbody id="member-detail">

				<?php if(empty($member)): ?><tr class="nodata center">

						<td colspan="11">

							<p><i class="iconfont icon-nothing fts20"></i></p>

							<p><?php echo L('NO_DATA');?></p>

						</td>

					</tr>

				<?php else: ?>

					<?php if(is_array($member)): $i = 0; $__LIST__ = $member;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

							<td><input type="radio" value="<?php echo encrypt($vo['member_id'],'MEMBER');?>" name="member" lay-skin="primary" /></td>

							<td><?php echo ($vo["name"]); ?></td>

							<td><?php echo ($vo["email"]); ?></td>

							<td><?php echo ($vo["mobile"]); ?></td>

							<td><?php echo CrmgetMemberGroupName($groupList,$vo['group_id']);?></td>

							<td><?php echo ($roleList[$vo['role_id']]['role_name']); ?></td>

						</tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

			</tbody>

		</table>

		<div class="right-list-page clearfix"><div class="feeldesk-page"><?php echo ($memberPage); ?></div></div>

	</div>

</div>

<script>

	$('input[name="selectMemberKeyword"]').unbind('keyup').keyup(function (e)
	{
		e.stopPropagation();

		if (e.keyCode == 13)
		{
			searchSelectMemberList();

			return false;
		}
	});

	$('.selectMemberBtn').unbind('click').bind('click',function(){

		searchSelectMemberList();

		return false;
	})

	function searchSelectMemberList()
	{
		var keyword = $('input[name="selectMemberKeyword"]').val();

		$.ajax({
			url:"<?php echo U('AjaxRequest/getMemberList');?>",
			type:'get',
			data:{'sMemberKeyword':keyword},
			async: false,
			datatype:'json',
			success:function(data)
			{

				$('#member-detail').html(data.html);

				$('#Memberlist .feeldesk-page').html(data.page);

				layui.use('form', function() {

					var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

					form.render();

				});

				$('#Memberlist .feeldesk-page a').click(function()
				{
					pageclick(this);

					return false;
				})

			},
			error:function()
			{
				layer.msg("<?php echo L('FAILED_TO_ACQUIRE_USER');?>");
			}
		});
	}

</script>


	<script>

		$(function(){

			$('#Memberlist .feeldesk-page a').click(function(){

				pageclick(this,'/Clue/detail');

				return false;
			})

		})

	</script>

	<div class="hidden hg100 div-layerframe feeldesk-form layui-form" id="abandonCust">

	<div class="feeldesk-form pd0 feelcrm-form">

		<div class="layui-tab">

			<ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('CHOOSE_GIVE_UP_REASON');?></li>

				<li class="tab-title-btn">

					<?php if((CONTROLLER_NAME) == "Customer"): if(!empty($customer["customer_id"])): ?><a href="javascript:abandonOperate('<?php echo U('customer/toPool');?>','<?php echo L('GIVE_UP');?>','<?php echo encrypt($customer['customer_id'],'CUSTOMER');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

							<?php else: ?>

							<a href="javascript:abandonOperate('<?php echo U('customer/toPool');?>','<?php echo L('GIVE_UP');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a><?php endif; ?>

					<?php else: ?>

						<?php if(!empty($clue["clue_id"])): ?><a href="javascript:abandonOperate('<?php echo U('clue/toPool');?>','<?php echo L('GIVE_UP');?>','<?php echo encrypt($clue['clue_id'],'CLUE');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a>

							<?php else: ?>

							<a href="javascript:abandonOperate('<?php echo U('clue/toPool');?>','<?php echo L('GIVE_UP');?>')" class="layui-btn layui-btn-normal titleSubmit"><?php echo l('SUBMIT');?></a><?php endif; endif; ?>

					<a href="javascript:closeLayerAll();" class="layui-btn layui-btn-normal titleCancel"><?php echo l('CANCEL');?></a>

					<div class="clear"></div>

				</li>

			</ul>

		</div>

	</div>

	<div class="form-content">

		<div class="form-item pb25 pt50 create-both-end">

			<div class="layui-form-item">

				<label class="layui-form-label">

				   <?php echo L('REASON_FOR_GIVING_UP');?>

				</label>

				<div class="layui-input-inline">

					<select name="abandon_id" id="abandon_id" lay-ignore >

						<option value=""><?php echo L('CHOOSE_GIVE_UP_REASON');?></option>

						<?php if(is_array($abandons)): $i = 0; $__LIST__ = $abandons;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["abandon_id"]); ?>" title="<?php echo ($v["abandon_name"]); ?>"><?php echo ($v["abandon_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

					</select>

					<script>

						$("#abandon_id").select2();

					</script>

				</div>

				<i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo L('ENTER_NAME_SEARCH');?>"></i>

			</div>

			<div class="layui-form-item layui-form-item-remark">

				<label class="layui-form-label"><?php echo L('REMARKS');?>：</label>

				<div class="layui-input-inline" style="line-height: 32px">

					<?php if((CONTROLLER_NAME) == "Customer"): echo L('GIVE_UP_REMARK',['name'=>L('CUSTOMER')]);?>

					<?php else: ?>

						<?php echo L('GIVE_UP_REMARK',['name'=>L('CLUE')]); endif; ?>

				</div>

			</div>

		</div>

	</div>

</div>


	<div class="comment-shade"></div>

	<div class="comment-panel hidden" id="comment">

		<header><span><?php echo L('COMMENT');?></span><i class="iconfont icon-guanbi comment-close" title="<?php echo L('CLOSE');?>"></i></header>

		<form action="<?php echo U('Customer/commentFollow');?>" id="commentForm" class="layui-form">

			<input type="hidden" name="comment[follow_id]" id="commentFollowId"/>

			<textarea id='commentEditor' name="comment[content]" cols="30" rows="10" placeholder="<?php echo L('ENTER_COMMENT_CONTENT');?>"></textarea>

			<div class="submit-comment"><a href="javascript:" class="layui-btn"><?php echo L('SUBMIT');?></a></div>

		</form>

	</div>

	<div class="">

	</div>

	<div class="customer-detail feeldesk-form pd0 feelcrm-form">

		<div class="customer-detail-content">

			<div class="detail-sidebar sidebar" id="closeCustomerDetail"><i class="iconfont icon-right"></i></div>

			<div class="customer-header h-auto">

				<div class="customer-header-name"><?php echo ($clue["detail"]["name"]); ?></div>

				<div class="customer-header-right">

					<?php if(in_array(($detailtype), explode(',',"index"))): if(($clue["isvalid"]) == "1"): if($clue['member_id'] > 0): if(($clue["status"]) != "2"): echo FEELCRM('Clue/transform',['id'=>encrypt($clue['clue_id'],'CLUE')],L('TRANSFORM'),'feelcrm-commbtn ml5');?>

									<?php if(!empty($istoPoolClueAuth)): if(($clue["status"]) != "2"): ?><a href="javascript:" class="feelcrm-commbtn ml5" data-id="<?php echo encrypt($clue['clue_id'],'CLUE');?>" data-href="<?php echo U('Clue/toPool');?>" data-name="<?php echo L('GIVE_UP_CLUES');?>" id="toPoolCustomer"><?php echo L('GIVE_UP');?></a><?php endif; endif; endif; ?>

								<?php if(!empty($istransferClueAuth)): ?><a href="javascript:" class="chooseMemberDetail feelcrm-commbtn ml5" data-id="<?php echo encrypt($clue['clue_id'],'CLUE');?>" data-href="<?php echo U('Clue/transfer');?>" data-name="<?php echo L('TRANSFER');?>" ><?php echo L('TRANSFER');?></a><?php endif; ?>

								<?php echo FEELCRM('Clue/delete',['id'=>encrypt($clue['clue_id'],'CLUE'),'type'=>encrypt('index','CLUE')],L('DELETE'),'feelcrm-commbtn ml5','trash');?>

								<?php else: ?>

								<?php if(!empty($isDrawClueAuth)): ?><a href="javascript:" class="feelcrm-commbtn ml5" data-id="<?php echo encrypt($clue['clue_id'],'CLUE');?>" data-href="<?php echo U('Clue/draw');?>" data-name="<?php echo L('RECEIVE');?>" id="drawOperate"><?php echo L('RECEIVE');?></a><?php endif; ?>

								<?php if(!empty($isAllotClueAuth)): ?><a href="javascript:" class="chooseMemberDetail feelcrm-commbtn ml5" data-id="<?php echo encrypt($clue['clue_id'],'CLUE');?>" data-href="<?php echo U('Clue/allot');?>" data-name="<?php echo L('DISTRIBUTION');?>" ><?php echo L('DISTRIBUTION');?></a><?php endif; ?>

								<?php echo FEELCRM('Clue/delete',['id'=>encrypt($clue['clue_id'],'CLUE'),'type'=>encrypt('pool','CLUE')],L('DELETE'),'feelcrm-commbtn ml5','trash'); endif; ?>

							<?php else: ?>

							<?php echo FEELCRM('Recover/re_clue',['id'=>encrypt($clue['clue_id'],'CLUE')],L('RECOVERY'),'feelcrm-commbtn ml5','batch');?>

							<?php echo FEELCRM('Clue/delete',['id'=>encrypt($clue['clue_id'],'CLUE'),'type'=>encrypt('index','CLUE')],L('DELETE'),'feelcrm-commbtn ml5','trash'); endif; endif; ?>

				</div>

				<div class="clear"></div>

				<div class="customer-system-info">

					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('SUBORDINATE_SECTOR');?></p><p class="system-nav-con"><?php echo CrmgetMemberGroupName($groupList,$clue['group_id']);?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('LEADER');?></p><p class="system-nav-con blue8"><?php echo ((isset($clue["member_name"]) && ($clue["member_name"] !== ""))?($clue["member_name"]):'<span class="iconfont icon-nothing gray1"></span>'); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('FINAL_FOLLOW-UP');?></p><p class="system-nav-con"><?php echo (getDates($clue["lastfollowtime"])); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('NEXT_CONTACT_TIME');?></p><p class="system-nav-con"><?php echo (getDates($clue["nextcontacttime"])); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('CREATE_TIME');?></p><p class="system-nav-con"><?php echo (getDates($clue["createtime"])); ?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('FOUNDER');?></p><p class="system-nav-con"><?php echo getCustomerCreateName($clue['creater_id'],$clue['creater_name']);?></p></div>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('STATUS');?></p><p class="system-nav-con"><?php echo getClueStatusName($clue['status'],'html');?></p></div>
					<?php if(($clue["status"]) == "2"): ?><div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('CUSTOMER');?></p><p class="system-nav-con"><a href="javascript:;" mini="customer" data-id="<?php echo encrypt($clue['customer_id'],'CUSTOMER');?>" data-type="detailPop" class="blue8"><?php echo ($clue["customer"]["name"]); ?></a></p></div><?php endif; ?>
					<div class="fl customer-system-info-nav" ><p class="system-nav-tit"><?php echo L('ENTRY_METHOD');?></p><p class="system-nav-con"><?php echo getCrmEntryMethod($clue['entry_method']);?></p></div>
				</div>

				<div class="clear"></div>


			</div>

			<div class="form-nav" id="detail-nav">

				<ul>

					<li><a href="javascript:;" class="form-tab active"><?php echo L('CLUE_DETAILS');?></a></li>

					<div class="clear"></div>

				</ul>

			</div>

			<!--<?php echo L('CUSTOMER_DETAIL');?>-->
			<!--<form class="layui-form">-->

			<div class="form-content form-content1 relative" style="overflow:inherit">

				<div class="<?php if(!in_array(($detailtype), explode(',',"index"))): ?>hidden<?php endif; ?>" >

					<div class="form-item pb25 pt10 ">

						<form class="layui-form" action="<?php echo U('clue/edit',['id'=>encrypt($clue['clue_id'],'CLUE'),'type'=>encrypt('detail','CLUE'),'detailtype'=>encrypt('index','CLUE')]);?>">

							<?php if(($clue["isvalid"]) == "1"): ?><a href="javascript:" class="feelcrm-commbtn fr edit-customer-detail" ><?php echo L('EDITOR');?></a>

								<a href="javascript:" class="feelcrm-commbtn fr finish-customer-detail" data-no="<?php echo ($clue["clue_prefix"]); echo ($clue["clue_no"]); ?>"><?php echo L('COMPLETE');?></a><?php endif; ?>

							<div class="clear"></div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label"><?php echo L('CLUE_NO');?></label>

								<div class="layui-input-inline"><?php echo ($clue["clue_prefix"]); echo ($clue["clue_no"]); ?></div>

								<div class="clear"></div>

							</div>

							<?php $t = 0; $ft = 0; $reg = 0; ?>

							<?php if(is_array($clueform)): $i = 0; $__LIST__ = $clueform;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
							<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><div class="layui-form-item mb10 wd50 fl">

									<label class="layui-form-label"><?php echo ($vo["form_description"]); ?></label>

									<div class="layui-input-inline <?php if(!empty($isEditClueAuth)): ?>pd0 detail-update-form<?php endif; ?>">

										<div class="layui-detail-edit-default" >

											<span class="fl"><?php echo ((isset($clue['detail'][$vo['form_name']]) && ($clue['detail'][$vo['form_name']] !== ""))?($clue['detail'][$vo['form_name']]):'--'); ?></span>

											<?php if($vo['form_name'] == 'phone' && $clue['detail'][$vo['form_name']]): ?><span class="fl icon-onclickcall"><i class="iconfont icon-boda blue8" onclick="CallUp(<?php echo ($clue['detail'][$vo['form_name']]); ?>,4);"></i></span><?php endif; ?>

											<div class="clear"></div>

										</div>

										<?php if(!empty($isEditClueAuth)): ?><div class="hidden layui-detail-edit-form">

												<?php if(($vo["form_type"]) == "date"): $ft++; endif; ?>

												<?php if(($vo["form_type"]) == "region"): $reg++; endif; ?>

												<?php $t++; ?>

												<?php echo W('Update/updateFormContent',[$clue,$clue['clue_id'],$vo,'clue',$t,$ft,$reg]);?>

											</div>

											<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

									</div>

									<div class="clear"></div>

								</div>

							<?php else: ?>

								<?php if(($vo["form_type"]) == "region"): ?><input type="hidden" name="clue_form[<?php echo ($vo["form_name"]); ?>_defaultCountry]" value="<?php echo ($clue[$vo['form_name']]['defaultCountry']); ?>" >
									<input type="hidden" name="clue_form[<?php echo ($vo["form_name"]); ?>_defaultProv]" value="<?php echo ($clue[$vo['form_name']]['defaultProv']); ?>" >
									<input type="hidden" name="clue_form[<?php echo ($vo["form_name"]); ?>_defaultCity]" value="<?php echo ($clue[$vo['form_name']]['defaultCity']); ?>" >
									<input type="hidden" name="clue_form[<?php echo ($vo["form_name"]); ?>_defaultArea]" value="<?php echo ($clue[$vo['form_name']]['defaultArea']); ?>" >

								<?php else: ?>

									<input type="hidden" name="clue_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($clue['detail'][$vo['form_name']]); ?>" ><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>

							<?php $tx = 0; ?>

							<?php if(is_array($clueform2)): $i = 0; $__LIST__ = $clueform2;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
							<?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><div class="layui-form-item mb10 wd100 layui-form-item-textarea fl">

									<label class="layui-form-label">

										<?php echo ($vo["form_description"]); ?>

									</label>

									<div class="layui-input-inline <?php if(!empty($isEditClueAuth)): ?>pd0 detail-update-form<?php endif; ?>">

										<div class="layui-detail-edit-default textareaImg">

											<?php echo ((isset($clue['detail'][$vo['form_name']]) && ($clue['detail'][$vo['form_name']] !== ""))?($clue['detail'][$vo['form_name']]):'--'); ?>

										</div>

										<?php if(!empty($isEditClueAuth)): $tx++; ?>

											<div class="hidden layui-detail-edit-form">

												<textarea class="layui-textarea layui-hide ticket-textarea" name="clue_form[<?php echo ($vo["form_name"]); ?>]" id="crmEditor<?php echo ($tx); ?>"><?php echo ($clue['detail'][$vo['form_name']]); ?></textarea>


											</div>

											<i class="i-update-success iconfont icon-system-success hidden"></i><?php endif; ?>

									</div>

									<div class="clear"></div>

								</div>

							<?php else: ?>

								<input type="hidden" name="clue_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($clue['detail'][$vo['form_name']]); ?>" ><?php endif; endforeach; endif; else: echo "" ;endif; ?>

							<div class="clear"></div>

						</form>

					</div>

				</div>



				<div class="form-nav pd0" id="customer-detail-nav">

					<ul>

						<?php if(($clue["isvalid"]) == "1"): if(!empty($isFollowAuthView)): ?><li><a href="javascript:void(0);" onclick="switchCustomerContent(this,1)" <?php if(($detailtype) == "index"): ?>class="active"<?php endif; ?>><?php echo L('CONTACT_RECORD');?></a></li>

								<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,9)" ><?php echo L('ATTACHMENT');?></a></li><?php endif; ?>

							<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,2)"><?php echo L('OPERATION_RECORD');?></a></li>

							<?php else: ?>

							<li><a href="javascript:void(0);" onclick="switchCustomerContent(this,2)" class="active"><?php echo L('OPERATION_RECORD');?></a></li><?php endif; ?>

					</ul>

				</div>

				<?php if(($clue["isvalid"]) == "1"): if(!empty($isFollowAuthView)): ?><!--<?php echo L('CONTACT_RECORD');?>-->
						<div class="customerDetailContent <?php if(($detailtype) != "index"): ?>hidden<?php endif; ?>" id="customer-detail-content1">

							<div class="form-content">

								<div class="layui-tab-content pb0 follow-default">

									<div class="layui-tab-item layui-show ">

										<div class="form-item">

											<div class="layui-form-item">

												<div class="layui-input-inline wd100">

													<input type="text" class="layui-input" placeholder="<?php echo L('ADD_CONTACT_RECORD');?>" name="" id="follow-entry">

												</div>

											</div>

										</div>

									</div>

								</div>

								<div class="layui-tab-content pb0 follow-tocreate hidden">

									<form action="<?php echo U('customer/create_follow',['id'=>encrypt($clue['clue_id'],'CLUE'),'detailtype'=>encrypt('index','CLUE'),'sourcetype'=>'clue']);?>" class="layui-form" method="post" enctype="multipart/form-data">

										<?php echo W('Follow/createFollow');?>

									</form>

								</div>

								<div class="feelcrm-follow">

									<?php echo W('Follow/followList',[$follow,$clue]);?>

								</div>

							</div>

							<script>

								$(function(){

									$('#follow-entry').click(function(){

										$('.follow-default').addClass('hidden');

										$('.follow-tocreate').show();

									})
								})

							</script>

							<script type="text/javascript">

								$(function()
								{
									layui.use(['layedit','form'], function()
									{
										var layedit = layui.layedit;

										var commentEditor = layedit.build('commentEditor',{hideTool:['strong','italic','underline','del','|','left','center','right','link','unlink','image','help'], height:120});

										$('.reply-comment,.comment-close').on('click',function()
										{
											$("#comment,.comment-shade").fadeToggle();

											var value = $(this).data('value');

											if(value != undefined)
											{
												$('#commentFollowId').val(value);
											}

											$('.submit-comment a').unbind('click').on('click',function()
											{
												layedit.sync(commentEditor);

												layer.load(2,{offset:['150px']});

												$.post("<?php echo U('Customer/commentFollow');?>",$('#commentForm').serialize(),function(data)
												{
													if(data.errcode == 0)
													{
														layer.msg(data.msg,{icon:1,time:1000,offset:['150px']},function()
														{
															window.location.reload();
														});
													}
													else
													{
														layer.closeAll('loading');

														layer.msg(data.msg,{icon:2,time:1500,offset:['150px']});
													}
												},'JSON')
											})
										})
									});

									$('.comment-more').on('click',function()
									{
										$(this).siblings('.comment-item:gt(2)').slideToggle('fast');

										$(this).find('i').toggleClass('icon-upward');
									});
								})

							</script>

						</div>

						<div class="customerDetailContent hidden" id="customer-detail-content9">

							<div class="feelcrm-follow border-none followContent" >

								<?php echo W('Follow/fileList',[$files]);?>

							</div>

						</div><?php endif; ?>

					<!--<?php echo L('OPERATION_RECORD');?>-->
					<div class="customerDetailContent <?php if(!empty($isFollowAuthView)): ?>hidden<?php endif; ?>" id="customer-detail-content2">

						<!--<div class="form-item pb25 pt20 ">

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('SUBORDINATE_SECTOR');?>

								</label>

								<div class="layui-input-inline">

									<?php echo CrmgetMemberGroupName($groupList,$clue['group_id']);?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('LAST_FOLLOW-UP_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($clue["lastfollowtime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('CUSTOMER_RESPONSIBLE');?>

								</label>

								<div class="layui-input-inline blue6">

									<?php echo ($clue["member_name"]); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('NEXT_CONTACT_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($clue["nextcontacttime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('FOUNDER');?>

								</label>

								<div class="layui-input-inline">

									<?php echo getCustomerCreateName($clue['creater_id'],$clue['creater_name']);?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('CREATE_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($clue["createtime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="clear"></div>

						</div>-->

						<?php if(!empty($abandon_log)): ?><!--<div class="customer-detail-title" >

								<span><?php echo L('GIVE_UP'); echo L('CLUE');?></span>

							</div>-->

							<div class="item-list wd100 pl0 pr0 border_b">

								<table class="layui-table mar0" lay-skin="line">

									<thead>

									<tr>

										<th class="common_con_th"><?php echo L('REASON_FOR_GIVING_UP');?></th><th><?php echo L('CLUE'); echo L('LEADER');?></th><th><?php echo L('OPERATOR');?></th><th><?php echo L('TIME');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($abandon_log)): $i = 0; $__LIST__ = $abandon_log;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td class="common_con_td" title="<?php echo ($vo["abandon_name"]); ?>"><?php echo ($vo["abandon_name"]); ?></td>

											<td><?php echo ($vo["member_name"]); ?></td>

											<td><?php echo ($vo["operator_name"]); ?></td>

											<td><?php echo (getDates($vo["createtime"])); ?></td>
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div><?php endif; ?>

						<div class="operate-info" id="CrmLogBox">


						</div>

						<script>

							layui.use('flow', function()
							{
								var flow = layui.flow;

								flow.load(
								{
									elem: '#CrmLogBox',
									scrollElem:'.feeldesk-main',
									isAuto:false,
									done: function(page, next)
									{
										var url = "<?php echo (ACTION_NAME); ?>";

										var clue_id = "<?php echo encrypt($clue['clue_id'],'CLUE');?>";

										var detailtype = "<?php echo encrypt($detailtype,'CLUE');?>";

										var lis = [];

										$.get("<?php echo U('clue/'.ACTION_NAME);?>?id="+clue_id+"&detailtype="+detailtype+"&p="+page+"&request=crmlog", function(data)
										{
											if(data.data)
											{
												if (data.data.length > 0) {
													layui.each(data.data, function (index, item) {
														var items = '<div class="operate-list">';

														if (item.member.face) {
															items += '<img src="' + item.member.face + '" alt="">';
														} else {
															items += '<img src="/Attachs/face/face.png" alt="">';
														}
														items += '&nbsp;&nbsp;&nbsp;<span class="blue8">' + item.member.name + '</span>';

														items += '<span class="gray9 fts12">&nbsp;• ' + item.createtime + '&nbsp;</span>';

														items += '<span>' + item.content + '</span>';

														items += '</div>';

														lis.push(items);
													});

													next(lis.join(''), page < data.pages);
												} else {
													var items = "";

													lis.push(items);

													next(lis.join(''), page < data.pages);
												}
											}
										});

									}
								});
							});

						</script>

					</div>

					<?php else: ?>

					<!--<?php echo L('OPERATION_RECORD');?>-->
					<div class="customerDetailContent" id="customer-detail-content2">

						<!--<div class="form-item pb25 pt20 ">

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('SUBORDINATE_SECTOR');?>

								</label>

								<div class="layui-input-inline">

									<?php echo CrmgetMemberGroupName($groupList,$clue['group_id']);?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('LAST_FOLLOW-UP_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($clue["lastfollowtime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('CUSTOMER_RESPONSIBLE');?>

								</label>

								<div class="layui-input-inline blue6">

									<?php echo ($clue["member_name"]); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('NEXT_CONTACT_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($clue["nextcontacttime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('FOUNDER');?>

								</label>

								<div class="layui-input-inline">

									<?php echo getCustomerCreateName($clue['creater_id'],$clue['creater_name']);?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="layui-form-item mb10 wd50 fl">

								<label class="layui-form-label">

									<?php echo L('CREATE_TIME');?>

								</label>

								<div class="layui-input-inline">

									<?php echo (getDates($clue["createtime"])); ?>

								</div>

								<div class="clear"></div>

							</div>

							<div class="clear"></div>

						</div>-->

						<?php if(!empty($abandon_log)): ?><!--<div class="customer-detail-title" >

								<span><?php echo L('GIVE_UP'); echo L('CLUE');?></span>

							</div>-->

							<div class="item-list wd100 pl0 pr0 border_b">

								<table class="layui-table mar0" lay-skin="line">

									<thead>

									<tr>

										<th class="common_con_th"><?php echo L('REASON_FOR_GIVING_UP');?></th><th><?php echo L('CLUE'); echo L('LEADER');?></th><th><?php echo L('OPERATOR');?></th><th><?php echo L('TIME');?></th>

									</tr>

									</thead>

									<tbody>

									<?php if(is_array($abandon_log)): $i = 0; $__LIST__ = $abandon_log;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

											<td class="common_con_td" title="<?php echo ($vo["abandon_name"]); ?>"><?php echo ($vo["abandon_name"]); ?></td>

											<td><?php echo ($vo["member_name"]); ?></td>

											<td><?php echo ($vo["operator_name"]); ?></td>

											<td><?php echo (getDates($vo["createtime"])); ?></td>
										</tr><?php endforeach; endif; else: echo "" ;endif; ?>

									</tbody>

								</table>

							</div><?php endif; ?>

						<div class="operate-info" id="CrmLogBox">


						</div>

						<script>

							layui.use('flow', function()
							{
								var flow = layui.flow;

								flow.load(
								{
									elem: '#CrmLogBox',
									scrollElem:'.feeldesk-main',
									isAuto:false,
									done: function(page, next)
									{
										var url = "<?php echo (ACTION_NAME); ?>";

										var clue_id = "<?php echo encrypt($clue['clue_id'],'CLUE');?>";

										var detailtype = "<?php echo encrypt($detailtype,'CLUE');?>";

										var lis = [];

										$.get("<?php echo U('clue/'.ACTION_NAME);?>?id="+clue_id+"&detailtype="+detailtype+"&p="+page+"&request=crmlog", function(data)
										{
											if(data.data)
											{
												if (data.data.length > 0) {
													layui.each(data.data, function (index, item) {
														var items = '<div class="operate-list">';

														if (item.member.face) {
															items += '<img src="' + item.member.face + '" alt="">';
														} else {
															items += '<img src="/Attachs/face/face.png" alt="">';
														}
														items += '&nbsp;&nbsp;&nbsp;<span class="blue8">' + item.member.name + '</span>';

														items += '<span class="gray9 fts12">&nbsp;• ' + item.createtime + '&nbsp;</span>';

														items += '<span>' + item.content + '</span>';

														items += '</div>';

														lis.push(items);
													});

													next(lis.join(''), page < data.pages);
												} else {
													var items = "";

													lis.push(items);

													next(lis.join(''), page < data.pages);
												}
											}
										});

									}
								});
							});

						</script>

					</div><?php endif; ?>
			</div>

	</div>

	</div>

	<script type="text/javascript">

		$('body').find('#closeCustomerDetail').click(function()
		{
			window.parent.postMessage('closeDetail','*');
		});

		window.addEventListener('message', function(e)
		{
			if(e.data)
			{
				window.formCustomer = 1;
			}
		}, false)

		$(function(){

			var Awidth = $('#detail-nav').width();

			var linum = $('#detail-nav ul').children("li").length;

			var liwidth = 130 * linum;

			if(Awidth > liwidth)
			{
				$('#detail-nav ul').css('min-width',Awidth+'px');
			}
			else
			{
				$('#detail-nav ul').css('min-width',liwidth+'px');
			}

			var Cwidth = $('#customer-detail-nav').width();

			var Clinum = $('#customer-detail-nav ul').children("li").length;

			var Cliwidth = 130 * Clinum;

			if(Cwidth > Cliwidth)
			{
				$('#customer-detail-nav ul').css('min-width',Cwidth+'px');
			}
			else
			{
				$('#customer-detail-nav ul').css('min-width',Cliwidth+'px');
			}
		})

	</script>

	<script type="text/javascript" src="/Public/js/submitform.js"></script>
<script type="text/javascript">
	
	layui.use('form',function()
	{
		var form = layui.form;
		
		form.render('checkbox');
		
		form.render('radio');
		
		form.render('select');

	})
	
</script>



    </div>

    <script type="text/javascript">

        layer.ready(function()
        {
            layer.photos({
                photos: '.textareaImg',
                shift: 5,
                shade: [0.8, 'rgba(0,0,0,.8)']
            });

        })

    </script>

    <script>

        //客户端
        /*if ( navigator.userAgent.toLowerCase().indexOf('electron/') > -1)
        {
            top.setIframe(document);
        }*/
    </script>

    </body>

</html>